
# @file:       CMakeLists.txt
# @author:     WubinWang
# @contact:    wubinstu@163.com
# @date:       2025-01-01
# @license:    MIT License
#
# Copyright (c) 2025 WubinWang
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
# DISCLAIMER:
# 1. User acknowledges all application risks and consequences arising from usage
#    of this software are exclusively borne by the user.
# 2. The original author shall not be held liable for any direct, indirect,
#    incidental, special, exemplary or consequential damages.
# 3. No warranty of fitness for particular purpose or non-infringement is provided.


cmake_minimum_required(VERSION 3.7...3.27)

project(cpplib
        DESCRIPTION "C/C++ Libs"
        VERSION 14.0.6
        LANGUAGES ASM C CXX)

if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -g -O0")
elseif(${CMAKE_BUILD_TYPE} STREQUAL "Release")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
endif()

set(CMAKE_C_STANDARD 23)
set(CMAKE_CXX_STANDARD 23)

# libs
add_subdirectory(buffer)
add_subdirectory(thread_pool)
add_subdirectory(point_container)
add_subdirectory(params)
add_subdirectory(trigger)
add_subdirectory(trigger_thread_pool)


# tests
add_subdirectory(test)


string(TIMESTAMP BUILD_TIMESTAMP "%Y-%m-%d %H:%M:%S")
message(STATUS "Build TimeStamp = ${BUILD_TIMESTAMP}")
message(STATUS "System Name = ${CMAKE_SYSTEM_NAME}")
message(STATUS "System Processor = ${CMAKE_SYSTEM_PROCESSOR}")
message(STATUS "C Compiler(F) = ${CMAKE_C_COMPILER}${CMAKE_C_FLAGS}")
message(STATUS "C++ Compiler(F) = ${CMAKE_CXX_COMPILER}${CMAKE_CXX_FLAGS}")
message(STATUS "Assembler = ${CMAKE_ASM_COMPILER}")
message(STATUS "Linker = ${CMAKE_LINKER}")
message(STATUS "Archiver = ${CMAKE_AR}")
message(STATUS "Make Program = ${CMAKE_MAKE_PROGRAM}")
message(STATUS "Project Name = ${CMAKE_PROJECT_NAME}")
message(STATUS "Project Version = ${CMAKE_PROJECT_VERSION}")
message(STATUS "Project Build Type = ${CMAKE_BUILD_TYPE}")
message(STATUS "Project Source Path = ${CMAKE_SOURCE_DIR}")
message(STATUS "C Language Standard = ${CMAKE_C_STANDARD}")
message(STATUS "CXX Language Standard = ${CMAKE_CXX_STANDARD}")
message(STATUS "Binary OutPut Path = ${PROJECT_BINARY_DIR}/${EXECUTABLE_OUTPUT_PATH}")
message(STATUS "Library Output Path = ${PROJECT_BINARY_DIR}/${LIBRARY_OUTPUT_PATH}")
message(STATUS "Install Path = ${CMAKE_INSTALL_PREFIX}")
